<template>
  <div>
    <PurchaseOrderTable ref="refOrderList" :tabsValue="tabsValue" :statusList="statusList"
                        @syncOnlineLogisticsOrders="syncOnlineLogisticsOrders"/>
    <!--  物流方案  -->
    <ReportInfo v-if="isOpenLogisticsModal" :logisticsInfo="logisticsFormInfo" :programmeForm="programmeForm"
                @reportInfoSwitch="reportInfoSwitch"/>
  </div>
</template>

<script>
import PurchaseOrderTable from "@/views/purchase/components/PurchaseOrderTable.vue";
import {declareProductInfo} from "@/api/order/purchaser";
import ReportInfo from "@/views/purchase/components/ReportInfo.vue";

export default {
  name: "pendPurchaseOrder",
  dicts: ['send_out_type'],
  components: {
    PurchaseOrderTable,
    ReportInfo
  },
  data() {
    return {
      tabsValue: "105",//已采购
      statusList: ['105'],
      logisticsFormInfo: {},//同步物流表单信息
      isOpenLogisticsModal: false,//是否打开物流弹窗
      programmeForm: [],
    }
  },
  created() {

  },
  methods: {
    // 同步线上物流订单
    syncOnlineLogisticsOrders(row) {
      declareProductInfo({orderId: row.orderId}).then(res => {
        this.programmeForm = res.data;
        this.logisticsFormInfo = {
          orderId: row.orderId,
          sellerLoginId: row.sellerLoginId,
        }
        this.isOpenLogisticsModal = true
      })
    },
    // 关闭物流填报信息弹窗
    reportInfoSwitch() {
      this.isOpenLogisticsModal = false
    },
  }
}
</script>

<style scoped>

</style>
